<template>
  <div class="wx-jump">
    <p class="confirm" @click="confirm">window.confirm</p>
    <h1>Youmeng</h1>
    <ul class="list">
      <li
        youmeng="1"
        :id="`li_${index}`"
        v-app-jump="{ params: { suid: '123456', scheme: url } }"
        v-for="(url, index) in urls"
        :key="url"
      >
        {{ index + 1 }}. {{ url }}
      </li>
    </ul>
    <h1>Normal</h1>
    <ul class="list">
      <li
        :id="`li_normal_${index}`"
        v-app-jump="{ to: url }"
        v-for="(url, index) in urls"
        :key="url"
      >
        {{ index + 1 }}. {{ url }}
      </li>
    </ul>
  </div>
</template>

<script>
  import qs from 'qs';

  export default {
    data() {
      return {
        scheme: '',
        urls: [
          `mtjimu://publish?type=article&state=${encodeURIComponent(
            JSON.stringify({ tags: ['abc', 'def'] }),
          )}`,
          'mtjimu://works?id=astgp7xfqdfe',
          'mtjimu://topic?id=t3akz0ehegw9',
          'mtjimu://opinion?id=tswt0ehrn1hf',
          'mtjimu://channel?id=22',
          'mtjimu://subchannel?id=10',
          'mtjimu://rank',
          'mtjimu://creators',
          'mtjimu://todays',
          'mtjimu://articles',
          `mtjimu://webview?url=${encodeURIComponent('https://jimu.movtile.com')}`,
          `mtjimu://webview?url=${encodeURIComponent(
            'https://www.baidu.com/s?wd=郭德纲&rsv_spt=1&rsv_iqid=0xaf6b5acb00024b7d&issp=1&f=8&rsv_bp=1&rsv_idx=2&ie=utf-8&tn=baiduhome_pg&rsv_dl=tb&rsv_enter=1&rsv_sug3=9&rsv_sug1=12&rsv_sug7=101&rsv_sug2=0&rsv_btype=i&prefixsug=%25E9%2583%25AD%25E5%25BE%25B7%25E7%25BA%25B2&rsp=9&inputT=2379&rsv_sug4=2379',
          )}`,
          'mtjimu://mymessage?type=comment',
          'mtjimu://mymessage?type=invitation',
          'mtjimu://mymessage?type=notice',
          'mtjimu://mymessage?type=chat',
          'mtjimu://publish',
          'mtjimu://course',
          'mtjimu://publish?type=video ',
          'mtjimu://publish?type=article',
          'mtjimu://publish?type=photo',
          'mtjimu://publish?type=topic',
        ],
      };
    },
    mounted() {},
    methods: {
      log(event, e = {}) {
        alert(event + JSON.stringify(e) + ': ' + this.scheme);
      },
      confirm() {
        window.confirm('123123');
      },
    },
  };
</script>

<style lang="less" scoped>
  .wx-jump {
    min-height: 100vh;
    // padding: 20px 0;
    .confirm {
      font-size: 20px;
      padding: 30px 20px;
    }

    h1 {
      font-size: 30px;
      padding: 20px 0;
    }

    .list {
      list-style: disc;
      font-size: 20px;
      line-height: 2;
    }
  }
</style>
